cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(RayMarching LANGUAGES CXX CUDA)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" "-std=c++17")

set(CMAKE_PREFIX_PATH E:/Tools/libtorch)
find_package(CUDA REQUIRED)
find_package(Torch REQUIRED)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" "${TORCH_CXX_FLAGS}")

set(SRCS raymarching.cuh raymarching.cu rayutil.cu  rayutil.h)
add_library(RayMarching SHARED ${SRCS})
set_property(TARGET RayMarching PROPERTY CXX_STANDARD 17)
target_link_libraries(RayMarching "${TORCH_LIBRARIES}")

add_executable(Tasts rayutil.cu  rayutil.h  cudaTest.cpp)
set_property(TARGET Tasts PROPERTY CXX_STANDARD 17)
target_link_libraries(Tasts "${TORCH_LIBRARIES}")